<template>
  <div class="notify">
    <div class="inner">
      <div class="close d-center" @click="close">
        <i class="el-icon-close" style="color: #e9e9eb"></i>
      </div>
      <div class="success">
        <div class="header">
          <i class="el-icon-check" style="color:white;background:#67C23A;"></i>
          <span>{{data.success.length}}项,删除成功</span>
        </div>
        <div class="main">
          <span v-for="(item,index) in data.success" :key="index">{{item}}</span>
        </div>
      </div>
      <div class="error">
        <div class="header">
          <i class="el-icon-close" style="color:white;background:#F56C6C;"></i>
          <span style="color:#F56C6C;">{{data.error.length}}项,删除失败</span>
        </div>
        <div class="main">
          <em v-if="data.error.length != 0" style="font-style:normal;">具体失败原因请去系统日志中查看</em>
        </div>
        <div class="main">
          <span v-for="(item,index) in data.error" :key="index">{{item}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "delname",
  props: ["data"],
  methods: {
    close() {
      this.$emit("close");
    }
  },
  mounted() {
    setTimeout(() => {
      this.close();
    }, 5000);
  }
};
</script>

<style lang="less" scoped>
.notify {
  position: fixed;
  top: 58px;
  right: 29px;
  width: 330px;
  background: #ffffff;
  border: 1px solid #ebeef5;
  border-radius: 9px;
  box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.09);
  padding: 14px 26px 14px 13px;
  z-index: 100000;
  .close {
    width: 16px;
    height: 16px;
    position: absolute;
    top: 20px;
    right: 16px;
    cursor: pointer;
  }
  .error,
  .success {
    width: 100%;
    .header {
      padding: 10px;
      width: 100%;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      i {
        width: 23px;
        height: 23px;
        background: #67c23a;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 16px;
      }
      span {
        font-size: 14px;
        font-family: Microsoft YaHei UI, Microsoft YaHei UI-Regular;
        font-weight: 400;
        text-align: left;
        color: #67c23a;
      }
    }
    .main {
      margin-left: 40px;
      width: calc(100% - 40px);
      display: flex;
      justify-content: flex-start;
      align-items: center;
      flex-wrap: wrap;
      border: 0;
      span {
        height: 25px;
        max-width: 240px;
        background: #f4f4f5;
        border: 1px solid #e9e9eb;
        border-radius: 3px;
        font-size: 12px;
        font-family: Microsoft YaHei UI, Microsoft YaHei UI-Regular;
        font-weight: 400;
        text-align: left;
        color: #909399;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 0 11px;
        margin-left: 8px;
        margin-bottom: 8px;
        white-space: nowrap;
        text-overflow: ellipsis !important;
        overflow: hidden;
      }
      em {
        margin: 0 0 8px 8px;
        font-size: 9px;
        color: #fbc4c4;
      }
    }
  }
}
</style>